package com.ruoyi.cms.service.impl;

import com.ruoyi.cms.domain.CmsSchoolInfo;
import com.ruoyi.cms.mapper.CmsSchoolInfoMapper;
import com.ruoyi.cms.service.ICmsSchoolInfoService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学校信息Service业务层处理
 *
 * @author houyong
 * @date 2025-11-08
 */
@Service
public class CmsSchoolInfoServiceImpl implements ICmsSchoolInfoService {
    @Autowired
    private CmsSchoolInfoMapper cmsSchoolInfoMapper;

    /**
     * 查询学校信息
     *
     * @param id 学校信息主键
     * @return 学校信息
     */
    @Override
    public CmsSchoolInfo selectCmsSchoolInfoById(String id) {
        return cmsSchoolInfoMapper.selectCmsSchoolInfoById(id);
    }

    /**
     * 查询学校信息列表
     *
     * @param cmsSchoolInfo 学校信息
     * @return 学校信息
     */
    @Override
    public List<CmsSchoolInfo> selectCmsSchoolInfoList(CmsSchoolInfo cmsSchoolInfo) {
        return cmsSchoolInfoMapper.selectCmsSchoolInfoList(cmsSchoolInfo);
    }

    /**
     * 新增学校信息
     *
     * @param cmsSchoolInfo 学校信息
     * @return 结果
     */
    @Override
    public int insertCmsSchoolInfo(CmsSchoolInfo cmsSchoolInfo) {
        cmsSchoolInfo.setCreateTime(DateUtils.getNowDate());
        return cmsSchoolInfoMapper.insertCmsSchoolInfo(cmsSchoolInfo);
    }

    /**
     * 修改学校信息
     *
     * @param cmsSchoolInfo 学校信息
     * @return 结果
     */
    @Override
    public int updateCmsSchoolInfo(CmsSchoolInfo cmsSchoolInfo) {
        cmsSchoolInfo.setUpdateTime(DateUtils.getNowDate());
        return cmsSchoolInfoMapper.updateCmsSchoolInfo(cmsSchoolInfo);
    }

    /**
     * 批量删除学校信息
     *
     * @param ids 需要删除的学校信息主键
     * @return 结果
     */
    @Override
    public int deleteCmsSchoolInfoByIds(String[] ids) {
        return cmsSchoolInfoMapper.deleteCmsSchoolInfoByIds(ids);
    }

    /**
     * 删除学校信息信息
     *
     * @param id 学校信息主键
     * @return 结果
     */
    @Override
    public int deleteCmsSchoolInfoById(String id) {
        return cmsSchoolInfoMapper.deleteCmsSchoolInfoById(id);
    }
}
